package com.lin.filegraph.utils.parser.node;

import org.eclipse.jdt.core.dom.ASTNode;

/**
 * @description:
 * @author: linhuaixu
 * @time: 2023/5/18 10:20
 */

public class JImportNode extends JTreeNode {

    private String importPackageName = null;// ����
    private String fullImportName = null;// ����
    public boolean isUserDefined;// �ж�ImportNode��Ӧ�İ��Ƿ����û��Զ����

    public JImportNode(String filePath, ASTNode astNode, String importPackageName, String fullImportName,
                       boolean isUserDefined) {
        super(filePath, astNode);
        this.importPackageName = importPackageName;
        this.fullImportName = fullImportName;
        this.isUserDefined = isUserDefined;
    }

    public String getImportPackageName() {
        return importPackageName;
    }

    public String getFullImportName() {
        return fullImportName;
    }

    public JFileNode getFileNode() {
        JTreeNode fatherNode = super.getFatherNode();
        if (fatherNode instanceof JFileNode) {
            return (JFileNode) fatherNode;
        } else {
            System.err.println("ERR");
            return null;
        }
    }

    @Override
    public String toString() {
        return "[ImportNode] " + fullImportName;
    }

}
